package cn.lg.soar.cms.biz.modules.other.model;

import cn.lg.soar.cms.biz.modules.other.entity.BlockItem;
import cn.lg.soar.common.util.BeanCopier;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 页面位置内容
 * @author luguoxiang
 * @since 2023-03-19
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Getter
@Setter
@Accessors(chain = true)
public class BlockItemVo {

    public static final BeanCopier<BlockItemVo, BlockItem> TO_ENTITY = BeanCopier.create(BlockItemVo.class, BlockItem.class);
    public static final BeanCopier<BlockItem, BlockItemVo> FROM_ENTITY = BeanCopier.create(BlockItem.class, BlockItemVo.class);

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "副标题")
    private String subtitle;

    @ApiModelProperty(value = "封面图")
    private String coverImage;

    @ApiModelProperty(value = "元数据(携带的参数，如：url、id、json)")
    private String metadata;

    public BlockItemVo(){
    }

    public BlockItemVo(BlockItem data) {
        FROM_ENTITY.copy(data, this);
    }

    public BlockItem toBlockItem(){
        return TO_ENTITY.convert(this);
    }

}
